<template>
  <view>
	 
	  
    <view class="qrcode" style="width: 250px; margin: 0 auto; margin-top: 100px;">
      <view v-for="(row, rowI) in modules" :key="rowI" style="display: flex;flex-direction: row;">
        <view v-for="(col, colI) in row" :key="colI">
          <view v-if="col.isBlack" style="width: 10px;height: 10px;background-color: black;">
            <!-- 黑色码点 -->
          </view>
          <view v-else style="width: 10px;height: 10px;background-color: white;">
            <!-- 白色码点 -->
          </view>
        </view>
      </view>
    </view>
	<div style="margin-top: 20px; text-align: center">请保存活动二维码</div>
	<div style="margin-top: 4px; text-align: center">2023年沈阳市秋季房交会</div>
	<div style="margin-top: 4px; text-align: center">优惠ID：{{id}}</div>
  </view>
</template>

<script>
	import config from '../../config.js';
	import UQRCode from '../../common/uqrcode.js';
	export default {
	    data() {
	      return {
			  id: Math.floor(Math.random() * 1000000000),
	        modules: []
	      }
	    },
	    onLoad() {
			this.ewmFun()
	      const qr = new UQRCode();
	      qr.data = this.id
	      qr.make();
	      this.modules = qr.modules;
	    },
	    methods: {
			ewmFun(){
				uni.request({
					url: config.host+'system/plate/app/ewm', 
					success: (res) => {
						
					}
				})
			},
	    }
	  }
</script>

<style lang="less">

</style>
